package server;

import java.util.List;



//localhost:8080/demo1/servlet1
public class Mapper {


    private List<Host> hosts;

    public List<Host> getHosts() {
        return hosts;
    }

    public void setHosts(List<Host> hosts) {
        this.hosts = hosts;
    }

    public class Host{
        private String name; // localhost
        private List<Context> contexts;

        public Host(String name, List<Context> contexts) {
            this.name = name;
            this.contexts = contexts;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public List<Context> getContexts() {
            return contexts;
        }
    }

    public class Context{
        private String appName; // demo1
        private List<Wrapper> wrappers;

        public Context(String appName, List<Wrapper> wrappers) {
            this.appName = appName;
            this.wrappers = wrappers;
        }

        public String getAppName() {
            return appName;
        }

        public void setAppName(String appName) {
            this.appName = appName;
        }

        public List<Wrapper> getWrappers() {
            return wrappers;
        }
    }

    public class Wrapper{
        private String servletUrl; //servlet1 web.xml里的servlet-name
        private HttpServlet servlet;

        public HttpServlet getServlet() {
            return servlet;
        }

        public void setServlet(HttpServlet servlet) {
            this.servlet = servlet;
        }

        public Wrapper(String servletUrl, HttpServlet servlet) {
            this.servletUrl = servletUrl;
            this.servlet = servlet;
        }

        public String getServletUrl() {
            return servletUrl;
        }

        public void setServletUrl(String servletUrl) {
            this.servletUrl = servletUrl;
        }
    }


}
